from django.contrib import admin

from Wallpaper.models import Wallpaper, Category, LiveCategory, LiveWallpaper


# Register your models here.
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'cover')
    list_editable = ('cover',)
    list_display_links = ('id', 'name')


@admin.register(Wallpaper)
class WallpaperAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'category', 'resolution', 'tag')
    list_display_links = ('id', 'title', 'category')
    fields = (
        ('title', 'category'),
        ('tag', 'orientation'),
        ('resolution', 'file_size', 'create_time'),
        'url',
        'image_display',
    )
    list_filter = ('category',)
    search_fields = ('tag',)
    readonly_fields = ('image_display', 'resolution', 'file_size', 'create_time')


@admin.register(LiveCategory)
class LiveCategoryAdmin(admin.ModelAdmin):
    pass


@admin.register(LiveWallpaper)
class LiveWallpaperAdmin(admin.ModelAdmin):
    pass
